<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class TDeviceExceptionStatistics extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('t_device_exception_statistics', function (Blueprint $table) {
             $table->engine = 'InnoDB';
             $table->charset = 'utf8';
             $table->collation = 'utf8_general_ci';
            // CONTENT
            $table->increments('id')->nullable(false)->comment('');
			$table->unsignedInteger('pdi_index')->nullable(false)->default(0)->comment('设备索引');
			$table->string('pdi_name', 50)->nullable(false)->default(0)->comment('设备名称');
			$table->integer('AreaId')->nullable(false)->default(0)->comment('区域编号');
			$table->integer('Co_ID')->nullable(false)->default(0)->comment('公司编号');
			$table->integer('normal_num')->nullable(false)->default(0)->comment('正常数量');
			$table->integer('exception_num')->nullable(false)->default(0)->comment('故障数量');
			
        });

        // DB::statement("alter table `t_device_exception_statistics` comment '设备异常统计表'");
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('t_device_exception_statistics');
    }
}
